/***********************************************************************//**
     \file InstrumentFactory		\author belot nicolas (karrakis)   
    \brief define Class InstrumentFactory                                        
    Instrument factory create new instrument from a file name             
    or else                                                               
 ************************************************************************//*
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef INSTRFACTORY_H
#define INSTRFACTORY_H 1
#include "libtrckr.h"
#include "Instrument.h"
namespace libtrckr {
class InstrumentFactory {
	/** \class libtrckr::InstrumentFactory
	    \brief create new instruments
	*/
	public :
	/**Create a new Instrument from a file */
	static Instrument* CreateInstrumentFromFile(string); //Create an instrument from a filename
	/**Create an Empty Instrument of a type */
	static Instrument* CreateInstrumentFromType(string); //Return an instrument from a type
	
	private :

	enum context_t {GLOBAL, ATTACK, SAMPLE};

	struct asample {
	string* note;
	string* file;
	int panning;
	float speed;
	};
	
	struct attak {
	string* name;
	uint cnt_smp;
	asample** samples;
	};
	
	struct global{
	string* name;
	string* type;
	string* tuning;
	string* directory;
	attak** attack;
	};

	static void setSample(string*,string*,asample*);
	static void setAttack(string*,string*,attak*);
	static void setGlobals(string*, string*,global*);
};
}
#endif

